package com.example.demo.dao;

import com.example.demo.po.dzmodel;
import com.example.demo.po.plmodel;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface AllDao {
//    查询所有评论
    @Select("select * from liuyan order by id desc")
    List<plmodel> findAll();

//    查询所有点赞数
    @Select("select number from dianzan where id=1")
    int selectdz();

//    点赞实现
    @Update("update dianzan set number=#{number} where id=1")
    public void countdz(int number);

//    提交评论
    @Insert("insert into liuyan(pltext) value(#{pltext})")
    public void add(String pltext);

//    删除评论
    @Delete("delete from liuyan where id=#{id}")
    public void delete(int id);
}
